package com.bjsxt.controller;

import com.bjsxt.pojo.Host;
import com.bjsxt.pojo.PageA;
import com.bjsxt.service.HostService;
import org.omg.PortableInterceptor.INACTIVE;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/host")
public class HostController {
    @Autowired
    private HostService hostService;
    //主持人的条件查询
    @RequestMapping("/findMoreHost")
    public PageA<Host> findMoreHost(Integer page,Integer rows,Host host){
        System.out.println(host);
        return hostService.finfMore(page, rows,host);
    }
  //主持人的当前权重的修改
    @RequestMapping("/updateHostStrong")
    /*接收的数据名称要和前台传递的数据的名称以及类型要一致*/
    public Integer updateHostStrong(Integer hid,String strong){
       return hostService.updateHostSrong(hid,strong);
    }

    //添加主持人
    @RequestMapping("/savaHost")
    public Integer savaHost(Host host){
        return  hostService.saveHost(host);
    }

    //修改主持人的状态
    @RequestMapping("/updateHostStatus")
    public Integer updateHostStatus(Integer []hids,String status ){
           return hostService.updateHostStatus(hids, status);

    }
}
